<?php
class Group_model extends MY_Model
{
	public
		$table = 'groups',
		$prKey = 'group_ID'
	;
	
	function __construct()
	{
		parent::__construct();

		$this->fields = array(
			'group_ID' => '',
			'group_name' => T_('Name'),
			'group_desc' => T_('Description'),
			'group_order' => T_('Order'),
			'group_status' => T_('Status'),
		);

		$this->rules = array(
			'group_name' => "trim|strip_tags|required|max_length[30]",
			'group_desc' => "trim|max_length[255]",
			'group_order' => "trim|required|integer|max_length[11]",
			'group_status' => "trim|required|max_length[255]",
		);
	}
	
	function getSelectOptions()
	{
		$query = $this->db->get($this->table);
		$options = array('0' => 'Select Access Level');
		
		foreach ($query->result() as $row)
		{
			$options[$row->group_ID] = $row->group_name; 
		}
		
		return $options;
	}
}
?>